<div class="modal-dialog modal-lg add-addr-dialog">
    <form>
    <div class="modal-content">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal">&times;</button>
            <h4 class="modal-title">{{controller.meta_title}}</h4>
        </div>
        <div class="modal-body">
            <section class="panel panel-default m-b-xs">
                <header class="panel-heading">
                    <span class="label bg-danger pull-right m-t-xs"></span>
                    发布人信息
                </header>
                <table class="table  m-b-none">
                    <thead>
                    <tr>
                        <th>会员姓名</th>
                        <th>会员类型</th>
                        <th>公司名称</th>
                        <th>联系电话</th>
                        <th>身份证号码</th>
                    </tr>
                    </thead>
                    <tbody>

                    <tr>
                        <td>{{user.real_name}}</td>
                        <td>{%if user.groupid ==11 %}<span> app会员</span>{%elif user.groupid ==12%}<span> 核心企业</span>{%endif%}</td>
                        <!--<td>{{user.org_type}}</td>-->
                        <td>{{user.gsmc}}</td>
                        <td>{{user.mobile}}</td>
                        <td>{{user.user_code}}</td>
                    </tr>

                    </tbody>
                </table>
            </section>
            <section class="panel panel-default m-b-xs">
                <header class="panel-heading">
                    <span class="label bg-danger pull-right m-t-xs"></span>
                    发布详情
                </header>
                <table class="table m-b-none">
                    <tbody>
                    {% if gongxufabu.status == 5 %}
                    <tr>
                        <td class="text-center"><a href="/admin/gongxufabu/offsale?id={{gongxufabu.id}}&operation=下架" class="text-info"
                            data-toggle="ajaxModal">下架</a>
                        </td> 
                    </tr>
                    {% endif %}
                    <tr>
                        <td class="active">信息标题</td>
                        <td colspan="5">{{gongxufabu.xinxibiaoti}}</td>
                    </tr>
                    <tr>
                        <td class="active">信息类型</td>
                        <td><span>{{gongxufabu.xinxileixing|get_gongxutype}}</span></td>
                        <td class="active">发布时间</td>
                        <td colspan="3">{{gongxufabu.chuangjianshijian}}</td>
                    </tr>
                    <tr>
                        <td class="active">商品类别</td>
                        <td>{{gongxufabu.shangpingleibie}}</td>
                        <td class="active">所在地区</td>
                        <td colspan="3">{{gongxufabu.diqu}}</td>
                    </tr>
                    <tr>
                        <td class="active">位置详细</td>
                        <td colspan="5">{{gongxufabu.suozaiweizhi}}</td>
                    </tr>
                    <tr>
                        <td class="active">商品数量</td>
                        <td>{{gongxufabu.shangpingshuliang}}</td>
                        <td class="active">商品价格</td>
                        <td>{{gongxufabu.jiage}}</td>
                    </tr>
                    <tr>
                        <td class="active">预计货款</td>
                        <td>{{gongxufabu.zongjia}}</td>
                        <td class="active">出成率</td>
                        <td class="{%if gongxufabu.xinxileixing==0 or gongxufabu.xinxileixing==1 %}inactive{%endif%}">{%if gongxufabu.chuchenglv %}{{gongxufabu.chuchenglv + "%"}}{%endif%}</td>
                    </tr>
                    <tr>
                        <td class="active">信息通道</td>
                        <td><span>{{gongxufabu.info_channel|get_channelname}}</span></td>
                        <td class="active">派单</td>
                        <td>{{gongxufabu.appmobile}}</td>
                    </tr>
                    <tr>
                        <td class="active">商品描述</td>
                        <td colspan="5">{{gongxufabu.leirongmiaoshu}}</td>
                    </tr>
                    {% if gongxufabu.check_remark %}
                    <tr>
                            <td class="active">{{gongxufabu.check_remark.remark_type|get_remark_type}}备注</td>
                            <td colspan="3">{{gongxufabu.check_remark.remark_contents}}</td>
                            <td class="active">备注时间</td>
                            <td colspan="2">{{gongxufabu.check_remark.remark_time|moment("YYYY-MM-DD HH:mm:ss")}}</td>
                    </tr>
                    {% endif %}
                    {% if gongxufabu.send_remark %}
                    <tr>
                            <td class="active">{{gongxufabu.send_remark.remark_type|get_remark_type}}备注</td>
                            <td colspan="3">{{gongxufabu.send_remark.remark_contents}}</td>
                            <td class="active">备注时间</td>
                            <td colspan="2">{{gongxufabu.send_remark.remark_time|moment("YYYY-MM-DD HH:mm:ss")}}</td>
                    </tr>
                    {% endif %}
                    {% if gongxufabu.review_remark %}
                    <tr>
                            <td class="active">{{gongxufabu.review_remark.remark_type|get_remark_type}}备注</td>
                            <td colspan="3">{{gongxufabu.review_remark.remark_contents}}</td>
                            <td class="active">备注时间</td>
                            <td colspan="2">{{gongxufabu.review_remark.remark_time|moment("YYYY-MM-DD HH:mm:ss")}}</td>
                    </tr>
                    {% endif %}
                    <tr>
                        <td class="active">释放备注</td>
                        <td colspan="5">{{gongxufabu.shifang_remark}}</td>
                    </tr>
                    <tr>
                        <td class="active">作废备注</td>
                        <td colspan="5">{{gongxufabu.zuofei_remark}}</td>
                    </tr>
                    </tbody>
                </table>
            </section>
            <section class="panel panel-default m-b-xs">
                <header class="panel-heading">
                    <span class="label bg-danger pull-right m-t-xs"></span>
                    图片详情
                </header>
                <table class="table  m-b-none">
                    <thead>
                    </thead>
                    <tbody>
                    {% for u in url %}
                    <tr>
                        <span class=""><img class="img-responsive img-thumbnail" src="{{u}}" ></span>
                    </tr>
                    {% else %}
                    <tr><td colspan="11"><div class="alert alert-warning alert-block">
                        <button data-dismiss="alert" class="close" type="button">×</button>
                        <p>暂无数据</p>
                    </div></td></tr>
                    {% endfor %}
                    </tbody>
                </table>
            </section>
        </div>
        <div class="modal-footer">
            <input type="hidden" value="{{gongxufabu.id}}" name="id">
            <a href="javascript:;" class="btn btn-default" data-dismiss="modal">关闭</a>

        </div>
    </div><!-- /.modal-content -->
    </form>
</div><!-- /.modal-dialog -->
<script>

    /**省市三级联动 */
    $(function () {
        $(document).on( "change","#province1",function (e) {
            var pid = $("#province1 option:selected").val();
            $.ajax({
                url: "/center/address/getarea",
                data: {"pid":pid},
                success: function(msg){
                    var province_arr = ['<option value="">--- 市 ---</option>']
                    $.each(msg,function name(k,v) {
                        province_arr.push('<option value="'+v.id+'">'+v.name+'</option>')
                    })
                    province_html = province_arr.join("")
                    $("#city1").html(province_html);
                } });
        })


        $(document).on( "change","#city1",function (e) {
            var pid = $("#city1 option:selected").val();
            $.ajax({
                url: "/center/address/getarea",
                data: {"pid":pid},
                success: function(msg){
                    var province_arr = ['<option value="">--- 县/区 ---</option>']
                    $.each(msg,function name(k,v) {
                        province_arr.push('<option value="'+v.id+'">'+v.name+'</option>')
                    })
                    province_html = province_arr.join("")
                    $("#county1").html(province_html);
                } });
        })

        //改价
        $("#adjust_amount").on("change",function (e) {
            var olde_order_amount = $(".olde_order_amount").text();
            var adjust_amount = $("#adjust_amount").val();
            var order_amount = Number(olde_order_amount)+Number(adjust_amount);
            $("#order_amount").text(formatCurrency(order_amount));
        })
    })
    function formatCurrency (num) {
        if (!num) num = "0";
        num = num.toString().replace(/\$|\,/g,'');
        if(isNaN(num))
            num = "0";
        var sign = (num == (num = Math.abs(num)));
        num = Math.floor(num*100+0.50000000001);
        var cents = num%100;
        num = Math.floor(num/100).toString();
        if(cents<10)
            cents = "0" + cents;
        for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
            num = num.substring(0,num.length-(4*i+3))+','+
                    num.substring(num.length-(4*i+3));
        return (((sign)?'':'-') + num + '.' + cents);
    }

</script>